# -*- coding: utf-8 -*-


class ImgSize(object):
    def __init__(self, length, w, h):
        self.l = length
        self.w = w
        self.h = h

    def __str__(self):
        return 'length: %d, width: %d, height: %d' % (self.l, self.w, self.h)


class Img(object):
    __FORMAT__ = 'unknown'
    __MAGIC__ = 'no magic'

    @classmethod
    def size(cls, fobj):
        raise NotImplementedError

    @classmethod
    def test(cls, fobj):
        return fobj.read(len(cls.__MAGIC__)) == cls.__MAGIC__
